import React, { useState } from 'react'
import {RouterProvider,createBrowserRouter} from 'react-router-dom'
import routes from './router/Index'
import { Button, ConfigProvider, Input, Space, theme as antdTheme } from 'antd';
function App() {
  const [data,setData]=useState('light')
  return (
    <div>
      
      <ConfigProvider
    theme={{
      // 1. 单独使用暗色算法
      algorithm:data==='bark'? antdTheme.darkAlgorithm:antdTheme.defaultAlgorithm,

      // 2. 组合使用暗色算法与紧凑算法
      // algorithm: [theme.darkAlgorithm, theme.compactAlgorithm],
    }}
  >
    
      <Button type="primary" onClick={()=>setData(data==='bark'?'light':'bark')}>Submit</Button>
    
    <RouterProvider router={createBrowserRouter(routes)}></RouterProvider>
  </ConfigProvider>
    </div>
  )
}
export default App



























